package com.jxc.utils;

import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionContext;

public class UserInfo {

	public  void  IsLogin()
	{
		ActionContext ctx = ActionContext.getContext();
		HttpServletResponse response = (HttpServletResponse) ctx
				.get(ServletActionContext.HTTP_RESPONSE);
		response.setHeader("Cache-Control", "no-cache");
		response.setContentType("text/json;charset=utf-8");
		HttpServletRequest request = (HttpServletRequest) ctx
		.get(ServletActionContext.HTTP_REQUEST);
		if(null!=request.getSession().getAttribute("sessionEntity"))
		{
			try {
				response.getWriter().print("yes");//添加成功
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		else
		{
			try {
				response.getWriter().print("no");//添加失账
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
	

	
}
